package org.hot100_6.leetcode206;

import org.leetcode.easy.ListNode;

public class Solution {
    public ListNode reverseList(ListNode head) {
       if (head==null || head.next==null){
           return head;
       }

       ListNode next = head.next;
       ListNode temp = next.next;
       next.next=head;
       head.next=reverseList(temp);

        return next;
    }
}
